package xyz.syyrjx.blog.service.impl;

import org.springframework.stereotype.Service;
import xyz.syyrjx.blog.dao.tool.ToolDao;
import xyz.syyrjx.blog.entity.Tool;
import xyz.syyrjx.blog.service.ToolService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ToolServiceImpl implements ToolService {
    @Resource
    private ToolDao dao;

    @Override
    public int countTool() {
        return dao.countTool();
    }

    @Override
    public List<Tool> queryToolInPage(Integer page) {
        return dao.selectToolInPage((page - 1) * 5,5);
    }

    @Override
    public boolean updateView(Integer id) {
        boolean flag = false;
        if(dao.updateView(id) > 0){
            flag = true;
        }
        return flag;
    }
}
